package com.tbsoft.ehr.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 员工档案信息
 * @author lizhenhua
 *
 */
@Entity
@Table(name="EHR_STAFFINFO")
public class StaffInfo extends BaseEntity {
	
	//档案主键
	private String staffId;
	// 姓名
	private String name;
	// 性别
	private String sex;
	// 出生年月
	private Date birthdate;
	// 职位
	private String post;
	// 入职日期
	private Date entrydate;
	
	// 离职日期
	private Date leavdate;
	//所属机构
	private Agency agency;
	
	// 所属部门
	private Department department;
	//服务客户
	private ServiceCustomer serviceCustomer;
			
	// 联系电话
	private String mobilphone;
	// QQ
	private String qq;
	// 邮箱
	private String email;
	// 备用邮箱
	private String spareEmail;
	// 紧急联系人
	private String contactMan;
	// 紧急联系人电话
	private String contactPhone;

	// 籍贯
	private String jiguan;
	// 民族
	private String minzu;
	// 身份证号码
	private String idcard;
	// 户口类型
	private String hkType;
	// 户口所在地
	private String hukou;
	// 现住址
	private String address;
	// 政治面貌
	private String zzmm;

	// 最高学历
	private String educationLevel;
	// 毕业院校
	private String graduatedUniversity;
	// 毕业时间
	private Date gradudatedTime;
	// 专业
	private String specialty;
	// 其他资质
	private String qtzz;

	// 婚否
	private String married;
	// 是否有小孩
	private String children;
	// 父亲姓名
	private String fatherName;
	// 父亲电话
	private String fatherPhone;
	// 母亲姓名
	private String motherName;
	// 母亲电话
	private String motherPhone;
	// 家庭地址
	private String homeAddress;

	// 社保电脑号
	private String sbzh;
	// 公积金账号
	private String gjjzh;

	//用户id
	private String userId;
	
	//职位状态：在职离职，初始化在职
	private String workStatus; 
	
	//档案状态：审核通过，审核不通过
	private String auditStatus;
	
	// 银行账户信息
	private List<Account> accounts = new ArrayList<Account>();
	
	//合同信息
	private List<Contract> contracts = new ArrayList<Contract>();
	
	public StaffInfo(){
		super();
	}
	public StaffInfo(String id){
		this.staffId = id;
	}
	@Id
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid")
	@Column(name="STAFF_ID")
	public String getStaffId() {
		return staffId;
	}
	public void setStaffId(String staffId) {
		this.staffId = staffId;
	}
	@Column(name="STAFF_NAME",nullable=false,length=50)
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="STAFF_SEX",length=4)
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	
	@Column(name="STAFF_BIRTHDATE",columnDefinition="date")
	public Date getBirthdate() {
		return birthdate;
	}
	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}
	@Column(name="STAFF_POST",length=20)
	public String getPost() {
		return post;
	}
	public void setPost(String post) {
		this.post = post;
	}
	@Column(name="STAFF_ENTRYDATE",columnDefinition="date")
	public Date getEntrydate() {
		return entrydate;
	}
	public void setEntrydate(Date entrydate) {
		this.entrydate = entrydate;
	}
	
	@Column(name="STAFF_LEAVEDATE",columnDefinition="date")
	public Date getLeavdate() {
		return leavdate;
	}
	public void setLeavdate(Date leavdate) {
		this.leavdate = leavdate;
	}
	
	@ManyToOne
	@JoinColumn(name="AGENCY_ID")
	public Agency getAgency() {
		return agency;
	}
	
	public void setAgency(Agency agency) {
		this.agency = agency;
	}
	
	@ManyToOne
	@JoinColumn(name="DEPARTMENT_ID")
	public Department getDepartment() {
		return department;
	}
	public void setDepartment(Department department) {
		this.department = department;
	}
	
	@ManyToOne
	@JoinColumn(name="SC_ID")
	public ServiceCustomer getServiceCustomer() {
		return serviceCustomer;
	}
	public void setServiceCustomer(ServiceCustomer serviceCustomer) {
		this.serviceCustomer = serviceCustomer;
	}
	
	@Column(name="STAFF_QQ",length=20)
	public String getQq() {
		return qq;
	}
	public void setQq(String qq) {
		this.qq = qq;
	}
	
	@Column(name="STAFF_MOBILPHONE",length=20)
	public String getMobilphone() {
		return mobilphone;
	}
	
	public void setMobilphone(String mobilphone) {
		this.mobilphone = mobilphone;
	}
	@Column(name="STAFF_EMAIL",length=50)
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	@Column(name="STAFF_SPAREMAIL",length=20)
	public String getSpareEmail() {
		return spareEmail;
	}
	public void setSpareEmail(String spareEmail) {
		this.spareEmail = spareEmail;
	}
	@Column(name="STAFF_CONTACTMAN",length=20)
	public String getContactMan() {
		return contactMan;
	}
	public void setContactMan(String contactMan) {
		this.contactMan = contactMan;
	}
	@Column(name="STAFF_CONTACTPHONE",length=20)
	public String getContactPhone() {
		return contactPhone;
	}
	public void setContactPhone(String contactPhone) {
		this.contactPhone = contactPhone;
	}
	@Column(name="STAFF_JIGUAN",length=50)
	public String getJiguan() {
		return jiguan;
	}
	public void setJiguan(String jiguan) {
		this.jiguan = jiguan;
	}
	@Column(name="STAFF_MINZU",length=50)
	public String getMinzu() {
		return minzu;
	}
	public void setMinzu(String minzu) {
		this.minzu = minzu;
	}
	@Column(name="STAFF_IDCARD",length=30,nullable=false)
	public String getIdcard() {
		return idcard;
	}
	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	@Column(name="STAFF_HKTYPE",length=20)
	public String getHkType() {
		return hkType;
	}
	public void setHkType(String hkType) {
		this.hkType = hkType;
	}
	@Column(name="STAFF_HUKOU",length=50)
	public String getHukou() {
		return hukou;
	}
	public void setHukou(String hukou) {
		this.hukou = hukou;
	}
	@Column(name="STAFF_ADDRESS",length=50)
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name="STAFF_ZZMM",length=20)
	public String getZzmm() {
		return zzmm;
	}
	public void setZzmm(String zzmm) {
		this.zzmm = zzmm;
	}
	@Column(name="STAFF_EDUCATION_LEVEL",length=20)
	public String getEducationLevel() {
		return educationLevel;
	}
	public void setEducationLevel(String educationLevel) {
		this.educationLevel = educationLevel;
	}
	
	@Column(name="STAFF_GRADUATE_UNIVERSITY",length=20)
	public String getGraduatedUniversity() {
		return graduatedUniversity;
	}
	public void setGraduatedUniversity(String graduatedUniversity) {
		this.graduatedUniversity = graduatedUniversity;
	}
	@Column(name="STAFF_GRADUATE_TIME",columnDefinition="date")
	public Date getGradudatedTime() {
		return gradudatedTime;
	}
	public void setGradudatedTime(Date gradudatedTime) {
		this.gradudatedTime = gradudatedTime;
	}
	@Column(name="STAFF_SPECIALTY",length=50)
	public String getSpecialty() {
		return specialty;
	}
	public void setSpecialty(String specialty) {
		this.specialty = specialty;
	}
	@Column(name="STAFF_QTZZ",length=250)
	public String getQtzz() {
		return qtzz;
	}
	public void setQtzz(String qtzz) {
		this.qtzz = qtzz;
	}
	@Column(name="STAFF_MARRIED",length=10)
	public String getMarried() {
		return married;
	}
	public void setMarried(String married) {
		this.married = married;
	}
	@Column(name="STAFF_CHILDREN",length=10)
	public String getChildren() {
		return children;
	}
	public void setChildren(String children) {
		this.children = children;
	}
	@Column(name="STAFF_FATHER_NAME",length=20)
	public String getFatherName() {
		return fatherName;
	}
	public void setFatherName(String fatherName) {
		this.fatherName = fatherName;
	}
	@Column(name="STAFF_FATHER_PHONE",length=20)
	public String getFatherPhone() {
		return fatherPhone;
	}
	public void setFatherPhone(String fatherPhone) {
		this.fatherPhone = fatherPhone;
	}
	@Column(name="STAFF_MOTHER_NAME",length=20)
	public String getMotherName() {
		return motherName;
	}
	public void setMotherName(String motherName) {
		this.motherName = motherName;
	}
	@Column(name="STAFF_MOTHER_PHONE",length=20)
	public String getMotherPhone() {
		return motherPhone;
	}
	public void setMotherPhone(String motherPhone) {
		this.motherPhone = motherPhone;
	}
	@Column(name="STAFF_HOME_ADDRESS",length=250)
	public String getHomeAddress() {
		return homeAddress;
	}
	public void setHomeAddress(String homeAddress) {
		this.homeAddress = homeAddress;
	}
	@Column(name="STAFF_SBZH",length=50)
	public String getSbzh() {
		return sbzh;
	}
	public void setSbzh(String sbzh) {
		this.sbzh = sbzh;
	}
	@Column(name="STAFF_GJJZH",length=50)
	public String getGjjzh() {
		return gjjzh;
	}
	public void setGjjzh(String gjjzh) {
		this.gjjzh = gjjzh;
	}
	
	@Column(name="STAFF_WORK_STATUS",length=10,updatable=false)
	public String getWorkStatus() {
		return workStatus;
	}
	
	public void setWorkStatus(String workStatus) {
		this.workStatus = workStatus;
	}
	
	@Column(name="STAFF_AUDIT_STATUS",length=20)
	public String getAuditStatus() {
		return auditStatus;
	}
	public void setAuditStatus(String auditStatus) {
		this.auditStatus = auditStatus;
	}
	
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@JoinColumn(name="STAFF_ID")
	public List<Account> getAccounts() {
		return accounts;
	}
	public void setAccounts(List<Account> accounts) {
		this.accounts = accounts;
	}
	
	@OneToMany(cascade=CascadeType.ALL,mappedBy="staff",fetch=FetchType.LAZY)	
	public List<Contract> getContracts() {
		return contracts;
	}
	public void setContracts(List<Contract> contracts) {
		this.contracts = contracts;
	}
	
	@Column(name="USER_ID",length=50,updatable=false)
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	
}
